<?php
require '../bin/Common/Message.class.php';
require '../bin/Common/Upload.class.php';
require '../bin/Common/Guid.class.php';
require '../bin/DBA/DB.class.php';
require '../bin/DAL/ProductsDAL.php';
require '../bin/BLL/ProductsBLL.php';
require '../bin/DAL/Parameter.class.php';
$guid = new Guid();
$gid = $guid->ToString();
$name = $_POST["txt_Name"];
$photo = $_FILES["file_Img"]["tmp_name"];
$chs_Content = $_POST["art_content1"];
$eng_Content = $_POST["art_content2"];
$deu_Content = $_POST["art_content3"];
$chs_classid = $_POST["chs_select"];
$eng_classid = $_POST["eng_select"];
$deu_classid = $_POST["deu_select"];
$filename = $_FILES["file_Img"]["name"];
$filetype = $_FILES["file_Img"]["type"];
$filesize = $_FILES["file_Img"]["size"];
$message = "";

$chs_arry = array(
	'classid' => $chs_classid,
	'name' => $name,
	'imgurl' => $photo,
	'content' => $chs_Content,
	'guid' => $gid
);
$eng_arry = array(
	'classid' => $eng_classid,
	'name' => $name,
	'imgurl' => $photo,
	'content' => $eng_Content,
	'guid' => $gid
);
$deu_arry = array(
	'classid' => $deu_classid,
	'name' => $name,
	'imgurl' => $photo,
	'content' => $deu_Content,
	'guid' => $gid
);
if (!Upload::up($filesize,$filetype,$filename,&$message))
{
	Message::show($message,"-1");
}
else
{
	ProductsBLL::SaveByChs_Products($chs_arry);
	ProductsBLL::SaveByEng_Products($eng_arry);
	ProductsBLL::SaveByDeu_Products($deu_arry);
}
?>